package threadspace.server;

import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

import threadspace.data.Student;

public class StudentDAOMock implements StudentDAO {
	
	Map<String, Student> data = new LinkedHashMap<String, Student>();

	@Override
	public void addStudent(Student student) {
		data.put(student.getGtid(), student);
		
	}

	@Override
	public void editStudent(Student student) {
		data.put(student.getGtid(), student);
		
	}

	@Override
	public List<Student> getAllStudents() {
		 return Collections.unmodifiableList(new ArrayList<Student>(data.values()));
	}

	@Override
	public void removeStudent(Student student) {
		data.remove(student.getGtid());
		
	}

}
